package org.kolonitsky.alexey.banner.components
{
	import flash.display.Loader;
	import flash.display.MovieClip;
	import flash.events.Event;
	import flash.events.ProgressEvent;
	import flash.net.URLRequest;

	public class Banner extends MovieClip
	{
		private var url: String = "assets/banner.swf"

		private var ldr: Loader = new Loader()
		
		public function Banner ()
		{
			ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoadComplete)
			ldr.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onLoadProgress)
			ldr.load(new URLRequest(url))
			addChild(ldr)
			super();
		}

		private function onLoadComplete (event:Event): void {
			trace("Banner: Load Complete")
		}

		private function onLoadProgress (event:ProgressEvent): void {
			trace("Banner: Load progress \t" + (event.bytesLoaded / event.bytesTotal) + "%")
		}

	}
}